package cn.goldgrid.web.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContext;

import net.sf.json.JSONObject;
import cn.utils.HtmlUtils;


public abstract class BaseAction {
	public void init(ServletContext sc){
	}
	
	public List htmlEscape(List list){
		List _ll =new ArrayList();
		if(list!=null){
			for (int i = 0; i < list.size(); i++) {
				Object o = list.get(i);
				if(o instanceof String){
					_ll.add(HtmlUtils.htmlEscape(o.toString()));
				}else{
					_ll.add(HtmlUtils.htmlEscape(JSONObject.fromObject(o).toString()));
				}
			}
		}
		return _ll;
	}
}
